<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>短信营销1-创建3</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="<%=path%>/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/animate.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="<%=path%>/hplus/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.css">
    <link href="<%=path%>/css/marketing/s_style.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <style> 
        .radio label{
            padding-left: 0;
        }

        .date{
            margin: -8px 20px 0 0;
        }

        .clockpicker{
            margin-top: -8px;
        }

        .i-checks label{
            float: left;
            margin-right: 10px;
        }

        .col-sm-offset-1{
            margin-top: 20px;
        }

        .tishi{
            margin-top: 7px;
            
        }

        .alert{
            position:absolute;
            top: -15px;
            left: 8%;
            display:none;
        }
        .text-center{
            width:50%;
            margin: 10px 0 20px;
        }
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="x_progress">
            <div class="s_line">
                <div class="s_progress_bar s_current" role="progressbar"
                     aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
                    <span class="sr-only_1">1</span>
                    <p class="x_color_bz">选择发送目标</p>
                </div>
                <div class="s_progress_bar s_current" role="progressbar"
                     aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
                    <span class="sr-only_2">2</span>
                    <p class="x_color_bz">编辑发送内容</p>
                </div>
            </div>
        </div>
        <div class="ibox-content">
            <div class="text-center"><h3>短信编辑器</h3></div>
            <form method="get" class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-1 control-label">批次名称</label>
                    <div class="col-sm-5">
                        <input id="name" type="text" class="form-control" placeholder="给这批短信起个名字，方便以后统计" maxlength="15" onblur="checkLength(this)"/>
                    </div>
                </div>
                <%--校验名字使用--%>
                <input id="originName" type="text" style="display:none"/>

                 <div class="form-group">
                    <label class="col-sm-1 control-label" data-toggle="modal" data-target="#myModal5">短信签名</label>
                    <div class="col-sm-5">
                        <select id="autograph" class="form-control" name="account" onchange="reloadCountWordNum()">
                            <option>zhfeat</option>
                            <option>选项 2</option>
                            <option>选项 3</option>
                            <option>选项 4</option>
                        </select>
                    </div>
                    <div class="tishi col-sm-6" style="position:relative;margin-left:-15px">
                        <img src="<%=path%>/images/marketing/help.png" />
                        <div class="col-sm-4 alert alert-success">
                            	如果没有签名，请联系您的售后人员。<!-- <a class="alert-link" href="notifications.html#">了解更多</a> -->
                        </div>
                    </div>                    
                </div>

               <div class="form-group">
                    <label class="col-sm-1 control-label">插入链接</label>
                        <div class="col-sm-5">
                            <div class="input-group">
                                <input type="text" class="form-control" id="testNoBtn" style="position:relative">
                                <i class="fa fa-times-circle" style="position:absolute;display:inline-block;right:25px;top:10px;z-index:232"></i>
                                <div class="input-group-btn">
                                    <buttonobn type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </buttonobn>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                </div>
                                <!-- /btn-group -->
                            </div>
                        </div>
                    <div class="tishi col-sm-6" style="position:relative;margin-left:-15px">
                        <img src="<%=path%>/images/marketing/help.png" />
                        <div class="col-sm-4 alert alert-success">
                            	没有活动去社交营销创建吧 <!-- <a class="alert-link" href="notifications.html#">了解更多</a> -->
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label">短信内容</label>
                    <div class="col-sm-5">                      
                        <textarea oninput="reloadCountWordNum()" id="ccomment" name="comment" class="form-control" required="" aria-required="true"></textarea>                       
	                    <div class=" text-right"> 
	                       <h6 class="col-sm-9 "></h6> <span class="text-right" id="current">70</span><span>/</span><span id="remain" class="text-left">0</span><span>条</span>
	                    </div>
                    </div>
                     <div class="tishi col-sm-6" style="position:relative;margin-left:-15px">
                        <img src="<%=path%>/images/marketing/help.png" />
                        <div class="col-sm-4 alert alert-success">
                                                                                       短信默认70字符，含回复TD退订及签名字符，如选择活动，默认扣除19个短链字符！
                        </div>
                    </div>      
                </div>
                
                <div class="form-group" hidden="">
                    <label class="col-sm-1 control-label">发送时间</label>
                    <div class="col-sm-5">
                        <div class="radio i-checks">
                            <label id="send_now">
                                <input id="input_now" type="radio" checked="" value="option1" name="a"> <i></i> 立即发送</label>
                        </div>
                        <div class="radio i-checks">
                            <label id="send_timer">
                                <input id="input_timer" type="radio"  value="option2" name="a"> <i></i> 定时发送
                            </label>
                            <div class="form-group" id="data_1">
		                        <div class="col-sm-4 input-group date" style="float:left;">
	                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
	                                <input id="day" type="text" class="form-control" >
	                            </div>
	                            <div class="col-sm-4 input-group clockpicker" style="float:left;" data-autoclose="true">
	                                <input id="hours" type="text" class="form-control" value="09:30">
	                                <span class="input-group-addon">
	                                        <span class="fa fa-clock-o"></span>
	                                </span>
	                            </div>
		                    </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-1 control-label">添加标签</label>
                    <div class="col-sm-5">
                        <input id="tag" type="text" class="form-control" maxlength="10" onblur="checkLength(this)"> <span class="help-block m-b-none">认真填写标签，有助于您更精确的找到客户</span>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-2 col-sm-offset-1">
                        <button onclick="javascript:preStep();" type="button" class="btn btn-outline btn-primary" style="margin-right:20px;">上一步</button>
                        <button onclick="javascript:cancelDialog();" type="button" class="btn btn-outline btn-primary">取消</button>
                    </div>
                    <div class="col-sm-2 col-sm-offset-1">
                        <button data-toggle="dropdown" class="btn btn-primary" type="button" aria-expanded="true">发送 <span class="caret"></span></button>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:save('formal');">提交审核</a>
                            </li>
                            <li><a href="javascript:;" data-toggle="modal" data-target="#myModal6">测试发送</a>
                            </li>
                        </ul>
                    </div>
                </div>                
            </form>
        </div>    
    </div>

    <div hidden="" class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header" style="padding: 15px 15px 10px;">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="text-left">提示</h4>
                </div>
                <div class="text-center" style="width:100%;height:60px;">
                    <p>您还没有签名，请创建签名</p>
                    <form method="get" class="form-horizontal col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">短信签名</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control">
                            </div>
                        </div>
                    </form>
                </div>
                 <div class="modal-footer" style="text-align:center;border-top:none;">
                     <button type="button" class="btn btn-primary k_verify">提交审核</button>
                 </div>
             </div>
        </div>
    </div> 


    <!-- 测试发送弹框 -->
    <div hidden="" class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content">
                <div class="modal-header" style="padding: 15px 15px 10px;">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="text-left">测试发送</h4>
                </div>
                <div class="text-center" style="width:100%;height:60px;">                    
                    <form method="get" class="form-horizontal col-sm-12" style="margin-top:30px;">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">测试号码</label>
                            <div class="col-sm-8">
                                <input id="test_phone" type="text" class="form-control">
                            </div>
                        </div>
                    </form>
                </div>
                 <div class="modal-footer" style="text-align:center;border-top:none;">
                     <button onclick="javascript:save('test');" type="button" class="btn btn-primary k_verify">发送</button>
                 </div>
             </div>
        </div>
    </div> 

    <script src="<%=path%>/hplus/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=path%>/hplus/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="<%=path%>/hplus/js/content.min.js?v=1.0.0"></script>
    <script src="<%=path%>/hplus/js/plugins/chosen/chosen.jquery.js"></script>
    <script src="<%=path%>/hplus/js/plugins/jsKnob/jquery.knob.js"></script>
    <script src="<%=path%>/hplus/js/plugins/jasny/jasny-bootstrap.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="<%=path%>/hplus/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <script src="<%=path%>/hplus/js/plugins/switchery/switchery.js"></script>
    <script src="<%=path%>/hplus/js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/iCheck/icheck.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="<%=path%>/hplus/js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/clockpicker/clockpicker.js"></script>
    <script src="<%=path%>/hplus/js/plugins/cropper/cropper.min.js"></script>
    
    <script src="<%=path%>/hplus/js/demo/form-advanced-demo.min.js"></script>
	<script src="<%=path%>/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
    <script type="text/javascript" src="<%=path%>/js/marketing/dialog.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
	   <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <script src="<%=path%>/js/marketing/validation.js"></script>
	<script type="text/javascript">
		var showText = "[活动短链]";
		var activityId = getUrlParam("activityId");
		
	    function getUrlParam(key){
	    	var reg = new RegExp("(^|&)"+ key +"=([^&]*)(&|$)");
	        var r = window.location.search.substr(1).match(reg);
	        if(r!=null)return  unescape(r[2]); return null;
	    }
	    
		$('#send_now').on('ifChecked', function(event){
			console.log("send_now---------->");
			sendTimeType=0;
	    });
	
		$('#send_timer').on('ifChecked', function(event){
			console.log("send_timer---------->");
			sendTimeType=1;
	    });
		
		$('.fa').on('click', function(event){
			$('#testNoBtn').val("");
			activity_id=0;
			activity_url="";
			refreshContent();
			
	    });
		
		function refreshContent(){
			var newContent="";
			var content=$('#ccomment').val();
			var splitContent=content.split(showText);
			for(var i=0;i<splitContent.length;i++){
				if(splitContent[i]!=shortUrl){
					newContent=newContent+splitContent[i];
				}
			}
			console.log("newContent-->"+newContent);
			$('#ccomment').val(newContent);
			shortUrl="";
			reloadCountWordNum();
		}
	
	
	</script>

	
	
    <script>
        //$(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
       
        var access_token=$.cookie('access_token');
    	var uid=$.cookie('uid');
    	
        //批次名称
        var name;
        //签名id
        var autograph_id;
        //签名名称
        var autograph_name;
        //活动id
        var activity_id;
        //短信内容
        var sms_content;
        //发送时间
        var send_time;
        //标签
        var tag;
        //短信批次id
        var id;
        //操作类型（创建，编辑，复制）
        var type;
        //活动名称
        var activityName;
        
        var  activity_url;
        //测试短信发送号码
        var  testPhone;
        
        var noActivity=false;
        
        var sendTimeObj=new Object();
        
        var sendTimeFlag="now";
        
        var copyId="";
        
        var deleteFlag=false;

        var sendTimeType=0;

        //默认全量
        var sendObjectType=0;

        //分组id
        var groupids="";


        //编辑短信-查询短信详情
        $(function(){
        	
        	if(activityId != null){
    			$.post("<%=path%>/activity/ajaxActivityDetail",{id:activityId},function(data){
    				if(data.status == "200"){
    					var activityObj = data.data;
    					activity_id=activityId;
    	            	activityName=activityObj.name;
    	            	noActivity=false;
    	            	refreshContent();
    	            	getShortUrl();
	    				$("#testNoBtn").val(activityName);
    				}
    			});
    		}
        	
            $('.tishi img').mouseover(function(){
                $(this).parent().find('.alert').show();
            });
            $('.tishi img').mouseout(function(){
                $(this).parent().find('.alert').hide();
            });
            //短信记录id
            id=getQueryString("id");
            type=getQueryString("type");
            copyId=getQueryString("copyId");
            sendObjectType=getQueryString("sendObjectType");
            getAutographList();
            
            if(type=="edit"){
            	getSmsData(id);
            }else if(type=="copy"){
            	getSmsData(copyId);
            	deleteFlag=true;
            }else{
            	deleteFlag=true;
            }
            var testBsSuggest = $("#testNoBtn").bsSuggest({
                url: "<%=path%>/activity/ajaxSmsActivity",
                showBtn: false,
                delayUntilKeyup: true,
                effectiveFields: ["name"],
                idField: "id",
                keyField: "name"
            }).on("onDataRequestSuccess", function (e, result) {
                console.log("onDataRequestSuccess: ", result);
            }).on("onSetSelectValue", function (e, keyWrod) {
            	activity_id=keyWrod.id;
            	activityName=keyWrod.name;
            	noActivity=false;
            	refreshContent();
                getShortUrl();
            }).on("onUnsetSelectValue", function (e) {
            	noActivity=true;
            });
            
            var myDate = new Date();
        	//获取当前年
        	var year=myDate.getFullYear();
        	//获取当前月
        	var month=myDate.getMonth()+1;
        	//获取当前日
        	var day=myDate.getDate(); 
        	$("#day").val(year+"-"+month+"-"+day);
            $('#day').datepicker({  
                todayBtn : "linked",  
                autoclose : true,  
                todayHighlight : true, 
                startDate : new Date()  
            }).on('changeDate',function(e){  
            	
            });
        })
        
        function getShortUrl(){
        	var url="<%=path%>/activity/ajaxActivityUrlToShort";
    		$.post(url, {
    			"id" : activity_id
    		}, function(data) {
    			
    			if (data.status == 200) {
    				shortUrl=data.data;
    				refreshContent();
    				$("#ccomment").val($("#ccomment").val()+showText);
    				reloadCountWordNum();
    			}else{
	        		errorDialog(data.message);
	        	}
    		});
        }
        
        //获取短信数据
        function getSmsData(id){
        	var url="<%=path%>/smsBatch/ajaxSmsBatchDetail";
    		$.post(url, {
    			"id" : id
    		}, function(data) {
    			if (data.status == 200) {
    				initHtml(data.data);
    			}else{
	        		errorDialog("获取数据失败",data.message);
	        	}
    		});
        }
        //初始化页面
        function initHtml(data){
        	console.log("data.name---->"+data.name);
        	activityName=data.activityName;
        	activity_id=data.activityId;
        	name=data.name;
        	tag=data.tag;
        	autograph_name=data.autograph;
        	sms_content=data.content;
        	send_time=data.sendTime;
        	sendTimeType=data.sendTimeType;
            groupids=data.groupids;

        	$("#name").val(name);
            $("#originName").val(name);
        	$("#ccomment").val(sms_content);
        	$("#tag").val(tag);
        	$('#testNoBtn').val(activityName);

        	var count=$("#autograph option").length;

   		    for(var i=0;i<count;i++){
   		        if($("#autograph ").get(0).options[i].text == autograph_name) {
   		            $("#autograph ").get(0).options[i].selected = true;  
   		            break;  
   		        }  
   		    }

        	if(activity_id!=''&&activity_id!=0){
        		getShortUrl();
        	}
        	reloadCountWordNum();
        }
        
        
        //获取标签列表
        function getAutographList(){
        	var url="<%=path%>/smsAutograph/ajaxAutographList";
    		$.post(url,function(data) {
    			if (data.status == 200) {
    				setAutographHtml(data.data);
    			}else{
	        		swal(
	        				"获取短信签名失败",
	        				"您还未设置短信签名，请联系您的售后人员创建短信签名，然后再来编辑短信批次内容！",
	            		    'error'
	            		  ).then(function () {
	            			  window.location.href='<%=path%>/view/sms/smsBatch';
	            		})
	        	}
    		});
        }
        
        //设置签名
        function setAutographHtml(data){
        	var html='';
        	for(var i in data){
        		html+='<option>'+data[i].name+'</option>'
        	}
        	$('#autograph').html(html);
        }

        //短信编辑-发送
        function save(flag){
        	var send_status=0;
        	if(flag=="formal"){
        		send_status=2;
        	}else if(flag=="test"){
        		var phone=$('#test_phone').val();
        		if(!validatemobile(phone)){
        			return ;
        		}
        	}
        		
        	name=$('#name').val();
        	autograph_name=$("#autograph  option:selected").text();
        	sms_content=$('#ccomment').val();
        	tag=$('#tag').val();

        	if(noActivity){
        		$('#myModal6').modal("hide");
        		errorDialog("保存失败","您选择的活动不存在，请重新选择!");
        		return "";
        	}
        	if(StringEmpty(name)&&StringEmpty(autograph_name)&&StringEmpty(sms_content)&&StringEmpty(tag)){
        		var url="<%=path%>/smsBatch/ajaxUpdateSmsBatch";
        		$.post(url, {
        			"id" : id,
        			"name" : name,
        			"autograph" : autograph_name,
        			"content" : sms_content,
        			"tag" : tag,
        			"activityId" : activity_id,
        			"activityUrl":activity_url,
        			"sendStatus":send_status,
        			"equivalenNum":smsPriceNum,
        		}, function(data) {
        			
        			if (data.status == 200) {
        				if(flag=="formal"){
        					formalSendMessage();
        				}else if(flag=="test"){
        					testSendMessage();
        				}else if(flag=="cancel"){
        					window.location.href='<%=path%>/view/sms/smsBatch';
        				}
        			}else{
    	        		errorDialog(data.message);
    	        	}
        		});
        	}else if(!StringEmpty(name)){
        		promptDialog("请输入短信批次名称");
        	}else if(!StringEmpty(autograph_name)){
        		promptDialog("请输入选择短信签名");
        	}else if(!StringEmpty(sms_content)){
        		promptDialog("请输入短信内容");
        	}else if(!StringEmpty(tag)){
        		promptDialog("请输入标签内容");
        	}
        	
        }

        //测试发送短信
        function testSendMessage(){
        	testPhone=$("#test_phone").val();
        	var url="<%=path%>/smsBatch/ajaxTestSendSms";
    		$.post(url, {
    			"id" : id,
    			"phone" : testPhone
    		}, function(data) {
    			
    			if (data.status == 200) {
    				$('#myModal6').modal("hide");
    				successDialog("发送成功","短信已成功发送至您的手机，请查看！");
    			}else{
	        		errorDialog(data.message);
	        	}
    		});
        }


        //提交审核后发送短信
        function formalSendMessage(){
        	var url="<%=path%>/smsBatch/ajaxSubmitAudit";
    		$.post(url, {
                "id" : id
    		}, function(data) {
    			
    			if (data.status == 200) {
    				OKDialog("提交成功");
    			}else{
	        		errorDialog(data.message);
	        	}
    		});
        }


        function cancelDialog(){
			swal({
				  title: '是否保存内容吗?',
				  text: "保存内容后您下次可以继续编辑此内容！",
				  type: 'warning',
				  showCancelButton: true,
				  confirmButtonColor: '#3085d6',
				  cancelButtonColor: '#d33',
				  confirmButtonText: '是',
				  cancelButtonText:'否'
				}).then(function () {
					save("cancel");
				},function (dismiss) {
				  if (dismiss === 'cancel') {
					  if(deleteFlag){
                          deleteOne(id);
					  }else{
						  window.location.href='<%=path%>/view/sms/smsBatch';
					  }
				  }
				})
		}
        
        
        function OKDialog(title,content){
        	swal(
        		    title,
        		    content,
        		    'success'
        		  ).then(function () {
        			  window.location.href='<%=path%>/view/sms/smsBatch';
        			})
        }
        
        
        var wordLength=0;
        var smsPriceNum=1;
        //当前
        var current;
        //剩余
        var remain;
        
        var initLength=6;
        
        var shortUrl;
        //更新新短信输入数量 
        function reloadCountWordNum(){
        	initLength=5;
        	autograph_name=$("#autograph  option:selected").text();
        	initLength=initLength+autograph_name.length+2;
        	sms_content=$('#ccomment').val();
        	if(isHaveStr(sms_content,"[活动短链]")){
        		initLength=initLength+13;
        	}
        	wordLength=sms_content.length;
        	if(smsPriceNum==1){
        		smsPriceNum=parseInt(((wordLength/(70-initLength))+1));
        	}else{
        		smsPriceNum=parseInt((((wordLength+initLength)/70)+1));
        	}
        	
        	
        	$('#remain').html(smsPriceNum);
        	if(smsPriceNum==1){
        		current=(70-initLength)-(wordLength%70);
        	}else{
        		current=70-((wordLength+initLength)%70);
        	}
        	$('#current').html(current);
        }
        
        function deleteOne(id){
        	var url="<%=path%>/smsBatch/ajaxDeleteSmsBatch"
        	$.post(url, {
				"id":id
			}, function(data) {
				if (data.status == 200) {
					window.location.href='<%=path%>/view/sms/smsBatch';
				}else {
					window.location.href='<%=path%>/view/sms/smsBatch';
				}
			});
        }

        function preStep(){
        	window.location.href='<%=path%>/view/sms/choseSendObject?type=edit&id='+id;
        }
       
    </script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
</html>
